home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / mint / mgr / sparcmgr / src.zoo / src / Makefile < prev    next >
Encoding:
Makefile  |  1989-09-29  |  14.2 KB  |  542 lines

  1. #                        Copyright (c) 1987 Bellcore
  2. #                            All Rights Reserved
  3. #       Permission is granted to copy or use this program, EXCEPT that it
  4. #       may not be sold for profit, the copyright notice must be reproduced
  5. #       on copies, and credit should be given to Bellcore where it is due.
  6. #       BELLCORE MAKES NO WARRANTY AND ACCEPTS NO LIABILITY FOR THIS PROGRAM.
  7.  
  8. #    $Header: Makefile,v 1.1 89/09/27 09:28:25 sau Exp $
  9. #    $Source: /m1/mgr.new/src/RCS/Makefile,v $
  10.  
  11. #
  12. #    compile flags:
  13. #      WHO:        muck utmp file so "who" works
  14. #      VI        code for vi mouse hack
  15. #      DEBUG        turns on lots of debugging code (for -d option)
  16. #      FASTMOUSE    xor mouse track
  17. #      BUCKEY    for keyboard operated "mouse" commands
  18. #      PRIORITY    for priority window scheduling instead of 
  19. #            round-robin; the active window gets higher priority
  20. #      CUT        for cut/paste (don't use)
  21. #      ALIGN        forces window alignment for fast scrolling
  22. #            use with 68010/68020 version only
  23. #      ALIGN32    Obsolete (expunged)
  24. #      WEIRD        does weird thing on window reshapes
  25. #      KILL        kills windows upon tty i/o errors
  26. #
  27. #      MALLOC    for malloc debugging code - you supply the malloc
  28. #
  29. #      SHRINK    use only some of the screen (define [XYWH]0 too)
  30. #
  31. #      NOSTACK    don't permit event stacking 
  32. #
  33. #      BELL        really ring the bell (works on at least sun 3's)
  34. #            You need to do a "mknod /dev/bell c 12 2"
  35. #
  36. #      KBD        read mgr input from the sun kbd, instead of stdin
  37. #            This permits redirection of console msgs to a window
  38. #
  39. #      FRACCHAR    fractional character movement stuff (experimental)
  40. #
  41. #      XMENU        extended menu stuff (experimental)
  42. #
  43.  
  44. #    bitblit libraries
  45. #       blit - template based 68020 asm code (fastest)
  46. #                    uses 32 bit alignment
  47. #         oblit - crufty sun-2 specific code (obsolete, use port instead)
  48. #                    uses 16 bit alignment
  49. #     port - template based portable "C" code  (monochrome only for now)
  50. #                    uses 32 bit alignment (or 16 or 8)
  51. #       pixrect - SUN's pixrect library: Useful for color
  52. #                    uses 16 bit alignment (mostly)
  53. #        stub_lib - Stub libraries for use as a basis for porting
  54.  
  55. LIBS=blit oblit pixrect stub_lib port
  56. #
  57. #        Standard compile flags
  58.  
  59. MGR=mgr
  60.  
  61. #    which bit-blit library to use
  62.  
  63. BLITDIR=blit
  64.  
  65. #    Use fast scrolling code (only works on 68010/68020)
  66.  
  67. DDEP = -DALIGN
  68. BIT_LIB =   $(BLITDIR)/blitlib.a
  69.  
  70. #    Specify other libraries here (such as -lpixrect)
  71.  
  72. OTHERLIB =
  73. INCL = ../lib
  74.  
  75. #    special version specific stuff goes here
  76.  
  77. MACHDEP_H =
  78. MACHDEP_C = fast_scroll.c
  79. MACHDEP_O = fast_scroll.o
  80.  
  81. #    This version number is unrelated to anything
  82.  
  83. VER = 3.3.2
  84. #
  85. # built-in path names:
  86. #
  87. ###########################################
  88.  
  89. INSROOT=/usr/mgr
  90. FLAG = -O
  91.  
  92. ###########################################
  93.  
  94. START=.
  95. DSAME = -DWHO -DVI -DBUCKEY -DDEBUG -DKILL -DCUT -DBELL \
  96.             -DKBD -DALIGN32 -DFRACCHAR
  97. #    FONTDIR:    where to find font files  (default: /usr/mgr/font)
  98. #    ICONDIR:    where to find icons      (default: /usr/mgr/icon)
  99. PATHFLAGS = -DFONTDIR=\"$(INSROOT)/font\" -DICONDIR=\"$(INSROOT)/icon\"
  100. #
  101. DFLAGS = $(DSAME) $(DDEP)
  102. CFLAGS = $(FLAG) $(DFLAGS) $(PATHFLAGS) -I. -I$(BLITDIR) -I$(INCL)
  103. FONT_LIB = ../font
  104. DEFAULT_FONT = $(FONT_LIB)/default.fnt
  105. INSDIR = $(INSROOT)/bin
  106. CPIO=src.cpio
  107. TAR=src.tar
  108. DEPEND = make.depend
  109. LOG=make.log
  110. #
  111. #    Versions of MGR
  112. #        mgr            - the default
  113. #        colormgr        - makes color mgr using SUN's pixrect library
  114. #        pixmgr        - makes a monochrome MGR using pixrect
  115. #        prodmgr        - makes an optimized (production) MGR with debugging stripped
  116. #        oldmgr        - Makes a pre 3.4 release (no special kbd and bell handling)
  117. #        sun2mgr        - makes a sun2 version (old bitblit code) [obsolete]
  118. #        oldsun2mgr    - makes a sun2 (release 1.x, old bitblit code) [obsolete]
  119. #        portmgr        - makes a monochrome MGR using the portable blit code
  120. #                            Use this one for a monochrome Sparc station
  121. #        stubmgr        - make a monochrome MGR with NO bitblit code
  122.  
  123. ALLMGRS = mgr port_mgr stub_mgr color_mgr prod_mgr old_mgr sun2_mgr \
  124.                     oldsun2_mgr pix_mgr
  125. ALLDOTFILES= .mgr .mgr_port .mgr_stub .mgr_color .mgr_prod .mgr_old .mgr_sun2 \
  126.                  .mgr_oldsun2 .mgr_pix
  127.  
  128. PORTCFILES = \
  129.     Write.c bitmaphead.c bitmapread.c border.c \
  130.     cut.c data.c debug_flags.c destroy.c \
  131.     do_buckey.c do_button.c do_event.c do_menu.c down_load.c \
  132.     erase_win.c font_subs.c get_font.c get_info.c get_menus.c \
  133.     get_rect.c get_text.c getshell.c graph_subs.c intersect.c \
  134.     kbd.c mgr.c mouse_get.c move.c move_box.c new_window.c print.c \
  135.     put_window.c scroll.c set_mode.c shape.c sigdata.c startup.c \
  136.     subs.c update.c utmp.c win_make.c win_stack.c win_subs.c \
  137.     write_ok.c 
  138.  
  139. CFILES = $(PORTCFILES) $(MACHDEP_C)
  140.  
  141. OFILES = \
  142.     Write.o bitmaphead.o bitmapread.o border.o \
  143.     cut.o data.o debug_flags.o destroy.o \
  144.     do_buckey.o do_button.o do_event.o do_menu.o down_load.o \
  145.     erase_win.o font_subs.o get_font.o get_info.o get_menus.o \
  146.     get_rect.o get_text.o getshell.o graph_subs.o intersect.o \
  147.     kbd.o mgr.o mouse_get.o move.o move_box.o new_window.o print.o \
  148.     put_window.o scroll.o set_mode.o shape.o sigdata.o startup.o \
  149.     subs.o update.o utmp.o win_make.o win_stack.o win_subs.o \
  150.     write_ok.o \
  151.     $(MACHDEP_O)
  152.  
  153. HFILES = \
  154.     $(INCL)/dump.h $(INCL)/window.h \
  155.     clip.h copyright.h default_font.h defines.h defs.h event.h \
  156.     font.h icons.h menu.h \
  157.     $(MACHDEP_H)
  158.  
  159. OTHER = \
  160.     Makefile \
  161.     copyright.c \
  162.     compile_font.c dependencies
  163.  
  164. ############################################################################
  165. all:    $(MGR) 
  166.  
  167. ############################################################################
  168. # stub mgr, using dummy bitblit code
  169. stubmgr:
  170.     $(MAKE) DSAME="-DWHO -DVI -DBUCKEY -DDEBUG -DKILL" \
  171.         INSROOT=$(INSROOT) \
  172.         DDEP= \
  173.         MACHDEP_C= MACHDEP_H= MACHDEP_O= \
  174.         OTHERLIB= \
  175.         BLITDIR=stub_lib \
  176.         FLAG=$(FLAG) \
  177.         MGR=mgr_stub \
  178.         VER=2.3
  179.  
  180. ############################################################################
  181. # port mgr, using dummy bitblit code
  182. # This will also make a sun-2 version
  183. portmgr:
  184.     $(MAKE) DSAME="-DDEBUG -DWHO -DVI -DBUCKEY -DKILL -DCUT \
  185.             -DALIGN32 -DBELL -DKBD -DFRACCHAR"  \
  186.         INSROOT=$(INSROOT) \
  187.         DDEP= \
  188.         MACHDEP_C= MACHDEP_H= MACHDEP_O= \
  189.         OTHERLIB= \
  190.         BLITDIR=port \
  191.         FLAG=$(FLAG) \
  192.         MGR=mgr_port \
  193.         VER=2.3
  194.  
  195. ############################################################################
  196. # color mgr, for sun 3/60, sun3/110 and sun-roadrunner
  197. colormgr:
  198.     $(MAKE) DSAME="-DWHO -DVI -DBUCKEY -DDEBUG -DKILL -DBELL -DKBD \
  199.             -DCOLOR -DFASTMOUSE" \
  200.         INSROOT=$(INSROOT) \
  201.         DDEP= \
  202.         MACHDEP_C= MACHDEP_H= MACHDEP_O= \
  203.         OTHERLIB=-lpixrect \
  204.         BLITDIR=pixrect \
  205.         FLAG=$(FLAG) \
  206.         MGR=mgr_color \
  207.         VER=2.3
  208.  
  209. ############################################################################
  210. # sun 3's production release (no debugging code, optimized)
  211. prodmgr:
  212.     $(MAKE) DSAME="-DWHO -DVI -DBUCKEY -DKILL -DCUT -DALIGN \
  213.             -DALIGN32 -DBELL -DKBD -DFRACCHAR"  \
  214.         INSROOT=$(INSROOT) \
  215.         FLAG=-O \
  216.         MGR=mgr_prod
  217.  
  218. ############################################################################
  219. # sun 3's (68020 based) pre release 3.4
  220. oldmgr:
  221.     $(MAKE) DSAME="-DWHO -DVI -DBUCKEY -DDEBUG -DKILL -DCUT -DALIGN"  \
  222.         INSROOT=$(INSROOT) \
  223.         FLAG=$(FLAG) \
  224.         MGR=mgr_old
  225.  
  226. ############################################################################
  227. # sun 2's (68010 based)
  228. sun2mgr:
  229.     $(MAKE) DSAME="-DWHO -DVI -DBUCKEY -DDEBUG -DKILL -DCUT -DBELL -DKBD \
  230.                -DALIGN" \
  231.         INSROOT=$(INSROOT) \
  232.         FLAG=$(FLAG) \
  233.         BLITDIR=oblit \
  234.         MGR=mgr_sun2
  235.  
  236. ############################################################################
  237. # sun 2's (68010 based) running pre-3.4 releases (i.e. 1.0)
  238. oldsun2mgr:
  239.     $(MAKE) DSAME="-DWHO -DVI -DBUCKEY -DDEBUG -DKILL -DCUT -DALIGN" \
  240.         INSROOT=$(INSROOT) \
  241.         FLAG=$(FLAG) \
  242.         BLITDIR=oblit \
  243.         MGR=mgr_oldsun2
  244.  
  245. ############################################################################
  246. pixmgr:
  247.     $(MAKE) DSAME="-DWHO -DVI -DBUCKEY -DDEBUG -DKILL -DCUT -DBELL -DKBD" \
  248.         INSROOT=$(INSROOT) \
  249.         DDEP= MACHDEP_C= MACHDEP_H= MACHDEP_O= \
  250.         BLITDIR=pixrect OTHERLIB=-lpixrect \
  251.         FLAG=$(FLAG) \
  252.         MGR=mgr_pix \
  253.         VER=2.3
  254.  
  255. ########################################################################
  256.  
  257. fast:    gang $(MGR)
  258.  
  259. #        Placing $(HFILES) and $(CFILES) in the dependency list let's us
  260. #        see which files actually caused the rebuild in the $(LOG).
  261. #        Other than that, and checking for their existence, they are not
  262. #        needed for the actual build of mgr.
  263.  
  264. $(MGR):    .$(MGR) $(HFILES) $(CFILES) $(OFILES) copyright.o version.o FRClibrary
  265.     -rm -f mgr
  266.     -mv $(MGR) _$(MGR)
  267.     $(CC) $(LFLAGS) $(FLAG) -o $(MGR) $(MALLOC) $(OFILES) version.o copyright.o \
  268.         $(BIT_LIB) $(OTHERLIB)
  269.     @date >> $(LOG)
  270.     echo "changed $?" >> $(LOG)
  271.     @size $(MGR)
  272.     @echo "$(MGR) on `date`" > .done
  273.     -ln $(MGR) mgr
  274.  
  275. .PRECIOUS: .$(MGR)
  276.  
  277. .$(MGR) gang:    default_font.h
  278.     rm -f $(OFILES) $(ALLDOTFILES) copyright.o .done
  279.     touch .$(MGR)
  280.     $(CC) -c $(CFLAGS) $(PORTCFILES)
  281.  
  282. default_font.h:
  283.         make compile_font
  284.         ./compile_font < $(DEFAULT_FONT) default_font \
  285.                  > default_font.h
  286.  
  287. compile_font:    compile_font.o
  288.         $(CC) $(LFLAGS) -o compile_font compile_font.o
  289.  
  290. #        All versions of MGR now use the 32 bit aligned fonts and icons
  291. #
  292. # pick the icon file with appropriate alignment 
  293. #    set up a link to the proper font directory as well
  294. #
  295. #icons.h:
  296. #        -rm icons.h
  297. #        -rm ../font    
  298. #        @if [ x$(ALIGN) = 32 ]; \
  299. #        then \
  300. #            echo 'Creating 32-bit aligned mouse icons'; \
  301. #            ln -s icons-32.h icons.h; \
  302. #            echo 'Setting links to 32-bit fonts'; \
  303. #            ln -s `pwd`/../font-32 ../font; \
  304. #        else \
  305. #            echo 'Setting links to 16-bit fonts'; \
  306. #            ln -s `pwd`/../font-16 ../font; \
  307. #            echo 'Creating 16-bit aligned mouse icons'; \
  308. #            ln -s icons-16.h icons.h; \
  309. #        fi
  310.  
  311. #    create mgr version information
  312.  
  313. version.c:    $(OFILES)
  314.         echo "/* compilation info for $(MGR) */"     > version.c
  315.         @echo " "                    >> version.c
  316.         @echo "char *version[]={"            >> version.c
  317.         @echo "   \"$(VER)\",\"`hostname`\",\"`date`\",">> version.c
  318.         @echo "   \"`echo $(DFLAGS) | sed 's/-D//g'`\",">> version.c
  319.         @echo "   \"$(INSROOT)\","            >> version.c
  320.         @echo "   \"`whoami`\","            >> version.c
  321.         @echo "   \"`strings /vmunix | grep 'Release'`\",">> version.c
  322.         @echo "   };"                    >> version.c 
  323.  
  324. # The optimizer botches on this one
  325.  
  326. fast_scroll.o:    fast_scroll.c
  327.         $(CC) -c -I$(BLITDIR) fast_scroll.c
  328.  
  329. #    put copyright data into text segment
  330. copyright.o:    copyright.c copyright.h
  331.         $(CC) -c $(FLAG) $(DFLAGS) -I$(BLITDIR) -R copyright.c
  332.  
  333. $(BLITDIR)/blitlib.a FRClibrary:
  334.         cd $(BLITDIR); $(MAKE) FLAG=$(FLAG) blitlib.a
  335. #        make blit library avaliable to the applications
  336.         -rm -f $(INCL)/blitlib.a $(INCL)/bitmap.h
  337.         -ln -s `pwd`/$(BLITDIR)/blitlib.a $(INCL)/blitlib.a
  338.         -ln -s `pwd`/$(BLITDIR)/bitmap.h $(INCL)/bitmap.h
  339.  
  340. $(LOG):        
  341.         echo "MGR version log > $(LOG)
  342.  
  343. clean:        
  344.         rm -f *.o version.c $(ALLDOTFILES) .done
  345.         @for i in $(LIBS); do \
  346.             (cd $$i; $(MAKE) clean); \
  347.         done    
  348.  
  349. clobber:
  350.         rm -f compile_font $(ALLMGRS)
  351.  
  352. install:    .done $(INSDIR) /dev/bwtwo0
  353.         cd $(INSDIR);  rm -f $(MGR)
  354.         cp $(MGR) $(INSDIR)
  355.         -/etc/chown root $(INSDIR)/$(MGR)  && \
  356.          chmod u+s,go-w $(INSDIR)/$(MGR)
  357.  
  358. .done:
  359.         @echo "No MGR available to install"
  360.  
  361. $(INSDIR):
  362.         mkdir $@
  363.  
  364. /dev/bwtwo0:
  365.         -/bin/su root -c 'cd /dev;  MAKEDEV bwtwo0'
  366.  
  367. tar:        
  368.         tar cf $(TAR) `make list`
  369.         
  370. depend:    
  371.         dependencies `$(MAKE) list` > $(DEPEND)
  372.         echo " header file dependencies written to $(DEPEND)"
  373.  
  374. list:
  375.     @for i in $(HFILES) $(CFILES) $(OTHER); do \
  376.         echo "$(START)/$$i"; \
  377.     done    
  378.     @for i in $(LIBS); do \
  379.         echo "${START}/$$i";\
  380.         if [ -d $$i ]; then \
  381.              cd $$i; $(MAKE) START=${START}/$$i list; cd ..;\
  382.         fi \
  383.     done    
  384.  
  385. cpio:
  386.     make -s list  |  sort -u  |  cpio -ocv > $(CPIO)
  387.  
  388.  
  389. # header file dependencies go here 
  390.  
  391. Write.o: \
  392.     Write.c
  393.  
  394. bitmaphead.o: \
  395.     bitmaphead.c $(INCL)/dump.h $(BLITDIR)/bitmap.h
  396.  
  397. bitmapread.o: \
  398.     bitmapread.c $(INCL)/dump.h $(BLITDIR)/bitmap.h
  399.  
  400. border.o: \
  401.     border.c $(BLITDIR)/bitmap.h defs.h defines.h
  402.  
  403. copyright.c:    copyright.h
  404.  
  405. copyright.o: \
  406.     $(BLITDIR)/bitmap.h
  407.  
  408. cut.o: \
  409.     cut.c $(BLITDIR)/bitmap.h defs.h defines.h font.h $(INCL)/window.h \
  410.     event.h
  411.  
  412. data.o: \
  413.     data.c $(BLITDIR)/bitmap.h defs.h defines.h font.h icons.h
  414.  
  415. debug_flags.o: \
  416.     debug_flags.c
  417.  
  418. destroy.o: \
  419.     destroy.c $(BLITDIR)/bitmap.h defs.h defines.h font.h event.h
  420.  
  421. do_buckey.o: \
  422.     do_buckey.c $(BLITDIR)/bitmap.h defs.h defines.h font.h \
  423.     event.h
  424.  
  425. do_button.o: \
  426.     do_button.c $(BLITDIR)/bitmap.h menu.h defs.h defines.h \
  427.     font.h event.h
  428.  
  429. do_event.o: \
  430.     do_event.c $(BLITDIR)/bitmap.h defs.h defines.h font.h event.h
  431.  
  432. do_menu.o: \
  433.     do_menu.c $(BLITDIR)/bitmap.h menu.h defs.h defines.h font.h
  434.  
  435. down_load.o: \
  436.     down_load.c $(BLITDIR)/bitmap.h font.h defs.h defines.h \
  437.     menu.h event.h $(INCL)/window.h
  438.  
  439. erase_win.o: \
  440.     erase_win.c $(BLITDIR)/bitmap.h defs.h defines.h
  441.  
  442. font_subs.o: \
  443.     font_subs.c $(BLITDIR)/bitmap.h font.h default_font.h $(INCL)/window.h
  444.  
  445. get_font.o: \
  446.     get_font.c $(BLITDIR)/bitmap.h font.h
  447.  
  448. get_info.o: \
  449.     get_info.c $(BLITDIR)/bitmap.h font.h defs.h defines.h menu.h \
  450.     event.h $(INCL)/window.h
  451.  
  452. get_menus.o: \
  453.     get_menus.c $(BLITDIR)/bitmap.h menu.h font.h
  454.  
  455. get_rect.o: \
  456.     get_rect.c $(BLITDIR)/bitmap.h defs.h defines.h
  457.  
  458. get_text.o: \
  459.     get_text.c $(BLITDIR)/bitmap.h defs.h defines.h font.h event.h
  460.  
  461. getshell.o: \
  462.     getshell.c $(BLITDIR)/bitmap.h defs.h defines.h
  463.  
  464. graph_subs.o: \
  465.     graph_subs.c $(BLITDIR)/bitmap.h
  466.  
  467. intersect.o: \
  468.     intersect.c $(BLITDIR)/bitmap.h defs.h defines.h
  469.  
  470. kbd.o: \
  471.     kbd.c $(BLITDIR)/bitmap.h defs.h defines.h
  472.  
  473. mgr.o: \
  474.     mgr.c $(BLITDIR)/bitmap.h defs.h defines.h menu.h font.h \
  475.     event.h
  476.  
  477. mouse_get.o: \
  478.     mouse_get.c
  479.  
  480. move.o: \
  481.     move.c $(BLITDIR)/bitmap.h defs.h defines.h event.h
  482.  
  483. move_box.o: \
  484.     move_box.c $(BLITDIR)/bitmap.h defs.h defines.h
  485.  
  486. new_window.o: \
  487.     new_window.c $(BLITDIR)/bitmap.h defs.h defines.h font.h \
  488.     menu.h
  489.  
  490. print.o: \
  491.     print.c
  492.  
  493. put_window.o: \
  494.     put_window.c $(BLITDIR)/bitmap.h font.h defs.h defines.h \
  495.     menu.h event.h $(INCL)/window.h clip.h
  496.  
  497. scroll.o: \
  498.     scroll.c $(BLITDIR)/bitmap.h defs.h defines.h clip.h
  499.  
  500. set_mode.o: \
  501.     set_mode.c
  502.  
  503. shape.o: \
  504.     shape.c $(BLITDIR)/bitmap.h defs.h defines.h font.h event.h
  505.  
  506. sigdata.o: \
  507.     sigdata.c
  508.  
  509. startup.o: \
  510.     startup.c $(BLITDIR)/bitmap.h defs.h defines.h
  511.  
  512. subs.o: \
  513.     subs.c $(BLITDIR)/bitmap.h font.h defs.h defines.h event.h
  514.  
  515. update.o: \
  516.     update.c $(BLITDIR)/bitmap.h defs.h defines.h clip.h
  517.  
  518. utmp.o: \
  519.     utmp.c
  520.  
  521. win_make.o: \
  522.     win_make.c $(BLITDIR)/bitmap.h font.h defs.h defines.h $(INCL)/window.h \
  523.     event.h
  524.  
  525. win_stack.o: \
  526.     win_stack.c $(BLITDIR)/bitmap.h font.h defs.h defines.h \
  527.     $(INCL)/window.h menu.h event.h
  528.  
  529. win_subs.o: \
  530.     win_subs.c $(BLITDIR)/bitmap.h font.h defs.h defines.h $(INCL)/window.h \
  531.     clip.h
  532.  
  533. write_ok.o: \
  534.     write_ok.c defines.h
  535.  
  536. fast_scroll.o: \
  537.     fast_scroll.c $(BLITDIR)/bitmap.h
  538.  
  539. compile_font.o: \
  540.     compile_font.c $(BLITDIR)/bitmap.h font.h
  541.  
  542.